<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="@{include} :: header"></head>
<style>
    .layui-form-item{
        margin-bottom: 8px;
    }
</style>
<body>
<div class="layuimini-container">
    <div class="layuimini-main">
        <div class="layui-row">
            <form style="margin: 10px 10px 10px 10px" class="layui-form layui-form-pane" id="signupForm">
                <input id="id" name="id" th:value="${town.id}" type="hidden" />
                <input id="parentId" name="parentId" th:value="${town.parentId}" type="hidden" />
                <input id="state" name="state" th:value="${town.state}" type="hidden" />
                <div class="layui-form-item">
                    <label class="layui-form-label" th:if="${town.parentId > 0}">村居名称：</label>
                    <label class="layui-form-label" th:if="${town.parentId == 0}">乡镇名称：</label>
                    <div class="layui-input-block">
                        <input id="townName" name="townName" th:value="${town.townName}" class="layui-input" type="text" />
                    </div>
                </div>

                <div class="layui-form-item">
                    <label class="layui-form-label">排序索引：</label>
                    <div class="layui-input-block">
                        <input id="sort" name="sort" th:value="${town.sort}" class="layui-input"  type="text">
                    </div>
                </div>


                <div class="layui-form-item" th:if="${town.gridLevel == 2 && (userType == 0 || userType == 1)}">
                    <label class="layui-form-label">是否可控：</label>
                    <div class="layui-input-block">
                        <select data-placeholder="--请选择--" name="isControl" id="isControl" class="form-control chosen-select">
                            <option value="0" th:selected="${town.isControl eq 0}">正常开启</option>
                            <option value="1" th:selected="${town.isControl eq 1}">禁用</option>
                        </select>
                    </div>
                </div>


                <div class="layui-form-item">
                    <div style="text-align: center;margin-top: 20px">
                        <button onclick="update()" class="layui-btn layui-btn-lg layui-btn-normal" >提交</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" th:src="@{/js/appjs/module/town/detail.js}"></script>
</body>
</html>
